home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / glibc-1.09 / glibc-1 / glibc-1.09.1 / sysdeps / standalone / m68k / m68020 / m68020.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-13  |  2.7 KB  |  89 lines

  1. /* Copyright (C) 1994 Free Software Foundation, Inc.
  2.    Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
  3.      On-Line Applications Research Corporation.
  4.  
  5. This file is part of the GNU C Library.
  6.  
  7. The GNU C Library is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU Library General Public License as
  9. published by the Free Software Foundation; either version 2 of the
  10. License, or (at your option) any later version.
  11.  
  12. The GNU C Library is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. Library General Public License for more details.
  16.  
  17. You should have received a copy of the GNU Library General Public
  18. License along with the GNU C Library; see the file COPYING.LIB.  If
  19. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  20. Cambridge, MA 02139, USA.  */
  21.  
  22. /*  m68020.h
  23.  *
  24.  *  This file contains macros which are used to access MC68020 
  25.  *  registers which are not addressable by C.  These are
  26.  *  useful when developing the board specific support.
  27.  */
  28.  
  29. #ifndef m68020_h__
  30. #define m68020_h__
  31.  
  32. typedef void ( *mc68020_isr )( void );
  33.  
  34. #define disable_intr( level ) \
  35.   { (level) = 0; \
  36.     asm volatile ( "movew   %%sr,%0 ; \
  37.                     orw     #0x0700,%%sr" \
  38.                     : "=d" ((level)) : "0" ((level)) ); \
  39.   }
  40.  
  41. #define enable_intr( level ) \
  42.   { asm volatile ( "movew   %0,%%sr " \
  43.                        : "=d" ((level)) : "0" ((level)) ); \
  44.   }
  45.  
  46. #define flash_intr( level ) \
  47.   { asm volatile ( "movew   %0,%%sr ; \
  48.                     orw     #0x0700,%%sr" \
  49.                        : "=d" ((level)) : "0" ((level)) ); \
  50.   }
  51.  
  52. #define get_vbr( vbr ) \
  53.   { (vbr) = 0; \
  54.     asm volatile ( "movec   %%vbr,%0 " \
  55.                        : "=a" (vbr) : "0" (vbr) ); \
  56.   }
  57.  
  58. #define set_vbr( vbr ) \
  59.   { register mc68020_isr *_vbr= (mc68020_isr *)(vbr); \
  60.     asm volatile ( "movec   %0,%%vbr " \
  61.                        : "=a" (_vbr) : "0" (_vbr) ); \
  62.   }
  63.  
  64. #define enable_caching() \
  65.   { register unsigned int _ctl=0x01; \
  66.     asm volatile ( "movec   %0,%%cacr" \
  67.                        : "=d" (_ctl) : "0" (_ctl) ); \
  68.   }
  69.  
  70. #define delay( microseconds ) \
  71.   { register unsigned int _delay=(microseconds); \
  72.     register unsigned int _tmp=123; \
  73.     asm volatile( "0: \
  74.                      nbcd      %0 ; \
  75.                      nbcd      %0 ; \
  76.                      dbf       %1,0 " \
  77.                   : "=d" (_tmp), "=d" (_delay) \
  78.                   : "0"  (_tmp), "1"  (_delay) ); \
  79.   }
  80.  
  81. #define enable_tracing() 
  82. #define cause_intr( X ) 
  83. #define clear_intr( X ) 
  84.  
  85. extern mc68020_isr     M68Kvec[];   /* vector table address */
  86.  
  87. #endif
  88. /* end of include file */
  89.